﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.XtraEditors;

namespace td.Core.Security
{
    public partial class ChangePassWord : DevExpress.XtraEditors.XtraForm// DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public ChangePassWord()
        {
            InitializeComponent();
            CenterToScreen();
        }
        public string NewPassWord
        {
            get { return this.tbNewPassWord1.Text.Trim(); }
        }
        public string OldPassWord
        {
            get { return this.tbOldPassWord.Text.Trim(); }
        }

        private void sbOK_Click(object sender, EventArgs e)
        {
            if (this.tbNewPassWord1.Text.Trim() == this.tbNewPassWord2.Text.Trim())
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
            else
            {
                XtraMessageBox.Show("两次输入的密码不一致，请重新输入！", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.tbNewPassWord1.Focus();
            }
        }

        private void sbCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }
    }
}